package cn.cau.epidemicsurveysystem.control;

import cn.cau.epidemicsurveysystem.service.DiseaseDataService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

/**
 * @projectName: gp2022
 * @package: cn.cau.epidemicsurveysystem.control
 * @className: DiseaseController
 * @author: zj
 * @description: 北京新冠疫情数据统计
 * @date: 2022/3/8
 * @version: 1.0
 */
@Controller
public class DiseaseInfoController {
    @Autowired
    DiseaseDataService diseaseDataService;

    @RequestMapping(value = "/Hat",method = RequestMethod.GET)
    public ModelAndView hello(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("Hat");
        return modelAndView;
    }

    @RequestMapping(value= "/Data",method = RequestMethod.GET)
    public @ResponseBody JSONObject getDiseaseData() {
     /*   System.out.println("hello");*/
        return  diseaseDataService.getDiseaseData();
    }

    @RequestMapping(value= "/HistoryData",method = RequestMethod.GET)
    public @ResponseBody JSONObject getDiseaseHistoryData() {
        return  diseaseDataService.getDiseaseHistoryData();
    }
}
